using System;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace Curriculum.Business.LectorDatos
{
	/// <summary>
	/// Summary description for VersionXML.
	/// </summary>
	[XmlRoot(Namespace="", IsNullable=false)]
	[Serializable]
	public class Version
	{
		[XmlElement(Form=XmlSchemaForm.Unqualified)]
		public ListaAntecedentesDatos antecedentesDatos;

		[XmlElement(Form=XmlSchemaForm.Unqualified)]
		public string numeroVersion;

		[XmlElement(Form=XmlSchemaForm.Unqualified)]
		public string versionMetadatos;

		public bool TieneAntecedentes()
		{
			return (this.antecedentesDatos.antecedentes != null);
		}
	}
	[Serializable]
	public class atributoAntecedente
	{
		[XmlAttribute()]
		public string idAtributo;

		[XmlText()]
		public string Value;
	
	}
	
	[XmlRoot(Namespace="Curriculum.LectoresXML.LectorDatos", IsNullable=false)]
	[Serializable]
	public class ListaAtributoAntecedente 
	{
		/// <remarks/>
		[XmlElement("atributo", Form=XmlSchemaForm.Unqualified)]
		public atributoAntecedente[] atributos;
	}

	[Serializable]
	public class ListaAntecedentesDatos//:IEnumerable
	{
		/// <remarks/>
		[XmlElement("antecedente", Form=XmlSchemaForm.Unqualified)]
		public Antecedente[] antecedentes;
	}

	[Serializable]
	public class Antecedente
	{
		[XmlAttribute()]
		public string idAntecedenteMetadato;

		[XmlAttribute()]
		public string idAntecedente;

		[XmlAttribute()]
		public int orden;
		
		[XmlElement(Form=XmlSchemaForm.Unqualified)]
			//[System.Xml.Serialization.XmlElementAttribute("atributo", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
		public ListaAtributoAntecedente atributos;

		public ListaAntecedentesDatos antecedentesDatos;
	}
}
